package com.mzy.basics.RuntimeGetrRuntime;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/5/29 21:45
 * @Version 1.0
 */
public class Demo {
    public static void main(String[] args) throws IOException {
        /**
         * windows下默认路径是C:\Windows\System32
         */
        Runtime runtime = Runtime.getRuntime();
        // 打开微信.exe
        runtime.exec("E:\\微信\\WeChat\\WeChat.exe");
        // 打开计算器.exe
        runtime.exec("calc");
        // 打开notepad记事本
        Process notepad = runtime.exec("notepad");

    }
}
